home *** CD-ROM | disk | FTP | other *** search
- property prActionW, prActionP, Active, mytype, mySprite, prbuttontype, button_entered, Paction_done
- global timebuffer2
-
- on beginSprite me
- button_entered = 0
- Active = 0
- mySprite = sprite(me.spriteNum)
- case mySprite.member.type of
- #field:
- mytype = 1
- #text:
- mytype = 2
- otherwise:
- alert("Text Button - z┬│y typ membera")
- end case
- end
-
- on mouseEnter
- cursor(-1)
- timebuffer2 = the timer
- button_entered = -1
- Paction_done = 0
- end
-
- on mouseLeave me
- setcursor(#CursorNormal)
- if Active then
- Active = 0
- end if
- end
-
- on mouseDown me
- Active = getactive(me)
- end
-
- on getactive me
- case mytype of
- 1:
- case prbuttontype of
- #line:
- return the mouseLine
- #word:
- return the mouseWord
- #char:
- return the mouseChar
- end case
- 2:
- v = getAt(the mouseLoc, 2) - mySprite.locV
- return locVToLinePos(mySprite.member, v)
- end case
- end
-
- on mouseUp me
- Current = getactive(me)
- if Active > 0 then
- if Current = Active then
- do(prActionW)
- end if
- end if
- Active = 0
- end
-
- on mouseWithin me
- if the mouseDown then
- exit
- end if
- if prActionP <> EMPTY then
- Current = getactive(me)
- if button_entered <> Current then
- timebuffer2 = the timer
- button_entered = Current
- Paction_done = 0
- end if
- if abs(the timer - timebuffer2) < 20 then
- exit
- end if
- if not Paction_done then
- Paction_done = 1
- do(prActionP)
- end if
- end if
- end
-
- on mouseUpOutSide
- setcursor(#CursorNormal)
- Active = 0
- end
-
- on getPropertyDescriptionList
- return [#prActionP: [#comment: "ActionP:", #default: EMPTY, #format: #string], #prActionW: [#comment: "ActionW:", #default: EMPTY, #format: #string], #prbuttontype: [#comment: "akcja na:", #default: #line, #format: #symbol, #range: [#word, #line, #char]]]
- end
-